import App from './App'
import { request, requests } from './util/request.js'
import { identity } from './util/identity.js'
import { storage } from './util/storage.js'
import { tabbar } from './util/tabbar.js'

const isDebug = false;

// #ifndef VUE3
import Vue from 'vue'
// import Vuex from 'vuex'
import './uni.promisify.adaptor'


// Vue.prototype.$request = request;
Vue.prototype.$request = request;
Vue.prototype.$requests = requests;
Vue.prototype.$identity = identity;
Vue.prototype.$storage = storage;
Vue.prototype.$tabbar = tabbar;
Vue.prototype.$debug = isDebug;

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'

export function createApp() {
  const app = createSSRApp(App)
  app.config.globalProperties.$request = request;
  app.config.globalProperties.$requests = requests;
  app.config.globalProperties.$identity = identity;
  app.config.globalProperties.$storage = storage;
  app.config.globalProperties.$tabbar = tabbar;
  app.config.globalProperties.$debug = isDebug;
  return {
    app
  }
}
// #endif
